// const { notEmpty } = require('../utils.js')

module.exports = {
  description: '创建vue-router模块',
  prompts: [],
  actions: data => {
    // const name = '{{properCase name}}'
    /**
     * employees 员工
     * settings 公司设置
     * permissions 权限管理
     * social_securitys 社保管理
     * approvals 审批管理
     * attendances 考勤管理
     * salarys 工资管理
     * departments 组织架构
     *
     * */
    const routeList = [
      {
        urlName: 'employees',
        routeName: 'employees',
        pathName: 'employees',
        title: '员工管理'
      },
      {
        urlName: 'settings',
        routeName: 'settings',
        pathName: 'setting',
        title: '公司设置'
      },
      {
        urlName: 'permissions',
        routeName: 'permissions',
        pathName: 'permission',
        title: '权限管理'
      },
      {
        urlName: 'social_securitys',
        routeName: 'social_securitys',
        pathName: 'social',
        title: '社保管理'
      },
      {
        urlName: 'approvals',
        routeName: 'approvals',
        pathName: 'approvals',
        title: '审批管理'
      },
      {
        urlName: 'attendances',
        routeName: 'attendances',
        pathName: 'attendances',
        title: '考勤管理'
      },
      {
        urlName: 'salarys',
        routeName: 'salarys',
        pathName: 'salarys',
        title: '工资管理'
      },
      {
        urlName: 'departments',
        routeName: 'departments',
        pathName: 'departments',
        title: '组织架构'
      }
    ]
    console.log(routeList)
    // const actions = [{
    //   type: 'add',
    //   path: `src/components/${name}/index.vue`,
    //   templateFile: 'plop-templates/component/index.hbs',
    //   data: {
    //     name: name,
    //     template: data.blocks.includes('template'),
    //     script: data.blocks.includes('script'),
    //     style: data.blocks.includes('style')
    //   }
    // }]

    return routeList.map(item => {
      return {
        type: 'add',
        path: `src/router/modules/${item.pathName}.js`,
        templateFile: 'plop-templates/router/index.hbs',
        data: {
          ...item
        }
      }
    })
  }
}
